namespace Digitalmes.Application.Mes;

/// <summary>
/// 设备警报项定义表
/// </summary>
public sealed class EquipAlarmItemDto : Dto
{
    /// <summary>
    /// 设备名称，可以为 null。
    /// </summary>
    [StringLength(32)]
    public string? EquipName { get; set; }

    /// <summary>
    /// 顺序号，从 1 开始
    /// </summary>
    [Range(1, 256)]
    public int Pos { get; set; }

    /// <summary>
    /// 警报内容
    /// </summary>
    [Required, NotNull]
    [StringLength(64)]
    public string? Content { get; set; }

    /// <summary>
    /// 警报等级
    /// </summary>
    public AlarmLevelEnum Level { get; set; }

    public string? LevelDesc => Level.Description();

    /// <summary>
    /// 警报分类
    /// </summary>
    [Required, NotNull]
    [StringLength(64)]
    public string? Classify { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 创建人
    /// </summary>
    public string? CreateUser { get; set; }

    /// <summary>
    /// 修改时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }

    /// <summary>
    /// 修改人
    /// </summary>
    public string? UpdateUser { get; set; }
}
